<template>
  <fieldset>
    <legend>响应式语法:ref</legend>
    <child ref="childCom"></child>
    <h1>{{ counter }}</h1>
    <input type="text" ref="ipt" />
  </fieldset>
</template>
<script setup>
import { ref, onMounted } from "vue";
import child from "./child.vue";
// let res = await Promise.resolve("123");
// console.log(res);
let counter = ref(10);
setTimeout(() => {
  console.log(counter);
  counter.value = 20;
}, 2000);
let ipt = ref();
let childCom = ref();
onMounted(() => {
  console.log(ipt.value);
  ipt.value.focus();
  console.log(childCom.value);
});
</script>
